// page/component/new-pages/user/user.js
Page({
  data:{
    thumb:'',
    nickname:'',
    orders:[],
    hasAddress:false,
    address:{}
  },
  onLoad(){
    var self = this;
    /**
     * 获取用户信息
     */
    wx.getUserInfo({
      success: function(res){
        self.setData({
          thumb: res.userInfo.avatarUrl,
          nickname: res.userInfo.nickName
        })
      }
    })
  },
  /*
  * 进入订单列表
  */
  onOrderList: function (e){
    let index = e.currentTarget.dataset.index;
    wx.navigateTo({
        url: '/pages/page11?index=' + index,
    });
  },
  /*
  * 收藏夹
  */
  onFavorite: function (){
    wx.navigateTo({
        url: '/pages/page14',
    });
  },
  /*
  * 地址管理
  */
  onAddress: function (){
    const self = this;
    wx.chooseAddress({
      success: function (res) {
      }
    });
  },
  onShow(){
  },
})
